package studyguide.ch09.graphics;

import javax.microedition.lcdui.Canvas;
import javax.microedition.lcdui.Graphics;

public class GraphicsCanvasE extends Canvas {

	protected void paint(Graphics g) {
		// Clear screen
		g.setColor(255, 255, 255);
		g.fillRect(0, 0, getWidth(), getHeight());
		
		// Vertical distance between objects:
		int yStep = getHeight() / 5;
		int y = 0;
		int xStep = getWidth() / 3;

		g.setColor(0x0000ff); // Blue

		y += yStep;
		g.fillArc(xStep, y, xStep, yStep, 90, 180);
		
		y += 2*yStep;
		g.drawArc(xStep, y, xStep, yStep, 0, 360);
	}

}
